<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>机器应用管理</title>

		<%@ include file="/commons/css_js_head.jsp"%>


		<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/base/machinesApplyAction!doAddApply.ts";
doAddBeforeUrl = "${ctx }/base/machinesApplyAction!doFindById.ts";
//doUpdateBeforeUrl = "${ctx }/base/tsMachinesAction!doFindById.ts";
//doDelUrl = "${ctx }/base/tsMachinesAction!doDelete.ts"
doAddApplyBeforeUrl="${ctx }/base/machinesApplyAction!doAddApply.ts"
doQueryByNameAndMsidUrl="${ctx }/base/machinesApplyAction!doList.ts"
//添加之前
function doAddBefore() {
	var _form = document.forms[0];
	if (doListUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doListUrl;
	_form.submit();
}

//增加应用之前

function doAddApply(){
	//var _form = document.forms[0];
	//if (doAddBeforeUrl == '') {
	//	alert('请设置正确的URL!');
	//	return false;
	//}
	var msid = document.getElementById("msid");
	tb_show("add","${ctx }/base/machinesApplyAction!doAddApply.ts?msid=" + msid.value+"&keepThis=true&TB_iframe=true&width=580&height=350&modal=true",false);
	//_form.action = doAddApplyBeforeUrl + "?msid=" + msid.value;
	//_form.submit();
}

//更新之前 
function doUpdateBefore(pkId) {
	var _form = document.forms[0];
	if (doUpdateBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doUpdateBeforeUrl + "?machinesId=" + pkId;
	_form.submit();
}

//删除
function doDel(pkId) {
	var _form = document.forms[0];
	if (doDelUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	_form.action = doDelUrl + "?machinesId=" + pkId;
	_form.submit();
}

//关闭小窗口
function onCancel()
{
	closeWindow();
}
function closeWindow()
{
	self.parent.tb_remove();
}


//根据名字查询
function doQueryByNameAndMsid(){
	var _form = document.forms[0];
	if (doQueryByNameAndMsidUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	
	var msid = document.getElementById("msid");
	_form.action = doQueryByNameAndMsidUrl + "?msid=" + msid.value;
	_form.submit();
	
}



</script>


	</head>
	<body style="overflow-x: hidden" >

		<!-- 标题 -->
		<div class="mTitle">
			<span class="hidsearch"><a href="javascript:void(0)"
				onClick="return chg('searchList');" id="ImgArrow"> <img
						src="${ctx}/images/icon_up.gif" id="imgButton" />
			</a> </span>
			<b class="bbig">已添加的应用平台</b>
			
		</div>

		<!--list -->
		<div class="searchBar" id="searchList" style="display: block;">
			<form action="${ctx }/base/machinesApplyAction!doList.ts?msid=${msid }" method="post">
				<table class="searchTable">
					<tr>
						<th>
							名称：
						</th>
						<td>
							<s:textfield name="name" theme="simple"></s:textfield>
						</td>
						
						
						
						<td>
							<input name="btn_query" type="button" class="btn" value="查询"
								onclick="doQueryByNameAndMsid()" />
							<input name="btn_query" type="button" class="btn" value="关闭"
								onclick="onCancel()" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div class="mainList">

			<table class="listTable">
				<tr>
					<th>序号</th>
					
					<th>
						名称
					</th>
					<th>
					    接口类型
					</th>
					<th>
						接口地址
					</th>
					<th>
						接口参数
					</th>
				</tr>

				<input type="hidden" value="${msid }" id="msid"/>
				<c:forEach var="appleServer" varStatus="status" items="${resList}">
				
				
					<tr align=center>
						
						<td>${status.index+1} </td>
						<td>
							${appleServer.name }
						</td>
						<td>
						<c:if test="${appleServer.interType == '0'}">  <span>Socket</span> </c:if>
						    <c:if test="${appleServer.interType == '1'}">  <span>Webservice</span> </c:if>
						    <c:if test="${appleServer.interType == '2'}">  <span>Http</span> </c:if>
						</td>
						<td>
							${appleServer.interAddress }
						</td>
						<td>
							${appleServer.interMethod }
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<!--end list -->

		<!-- 分页区域  -->


<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
    return "zoneList";
}
</script>

	</body>
</html>
